import { createApp } from 'vue';
import App from './App.vue';
import { store, key } from './store/router';  // vuex
// 注入路由
import router from './router';
// 引入 antd
import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/reset.css';
// 注入ui组件库
import ElementPlus,{ElNotification} from 'element-plus';
import 'element-plus/dist/index.css';
import 'xe-utils'
import VXETable from 'vxe-table'
import 'vxe-table/lib/style.css'
// 引入font-awesome
import '@/assets/font-awesome/css/font-awesome.css';
import * as ElIcons from '@element-plus/icons-vue';
import AuthorInfo from '@/components/author-info/index.vue';
import ArticleLabel from '@/components/article-label/index.vue';
import WebSiteInfo from '@/components/website-info/index.vue';

// 当前时间格式
import {currentFormat} from '@/script/utils';
// 导入store
import pinia from './store'

import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn';
dayjs.locale('en')

const app = createApp(App);

// 批量注入icon图标组件
Object.keys(ElIcons).forEach(key =>{
    app.component( key, ElIcons[key]);
})

app.component('AuthorInfo', AuthorInfo)
app.component('ArticleLabel', ArticleLabel)
app.component('WebSiteInfo', WebSiteInfo)

app.use(ElementPlus);
app.use(Antd);
app.use(VXETable);
app.use(store, key);
app.use(router);
app.use(pinia);
app.mount('#app');
// 挂载方法
app.config.globalProperties.$currentFormat = currentFormat;